<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>分屏列表</h2>
    </div>
    <div class="cf">
       <!-- <div class="fl">
            &lt;!&ndash;<a class="btn" href="{:U('User/add')}">新 增</a>&ndash;&gt;
            <button class="btn ajax-post" url="{:U('Store/changeStatus',array('method'=>'resume'))}" target-form="ids">启 用</button>
            <button class="btn ajax-post" url="{:U('Store/changeStatus',array('method'=>'forbid'))}" target-form="ids">禁 用</button>
            <button class="btn ajax-post confirm" url="{:U('Store/changeStatus',array('method'=>'delete'))}" target-form="ids">删 除</button>
        </div>-->

    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table class="">
            <thead>
            <tr>

                <th class="">所属店铺</th>
                <th class="">分屏名称</th>
                <th>设备编号</th>
                <th class="">定向曝光数</th>
                <th class="">定向引流数</th>
                <th class="">添加时间</th>
                <th class="">状态</th>
                <th class="">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td>
                            <div>
                                <div style="display: inline-block;align-content: center">{$vo.store_name}</div>
                            </div>
                        </td>
                        <td>
                            <div>
                                <div style="display: inline-block;align-content: center">{$vo.title}</div>
                            </div>
                        </td>
                        <td>{$vo.equipment}</td>
                        <td>{$vo.up_num}</td>
                        <td>{$vo.in_num}</td>
                        <td>{$vo.create_at}</td>
                        <td>{$vo.status_text}</td>
                        <td>
                            <a href="{:U('Screen/edit?id='.$vo['id'])}">编辑</a>
                            <eq name="vo.status" value="1">
                                <a href="{:U('Screen/changeStatus?method=forbid&id='.$vo['id'])}" class="ajax-get">禁用</a>
                                <else/>
                                <a href="{:U('Screen/changeStatus?method=resume&id='.$vo['id'])}" class="ajax-get">启用</a>
                            </eq>
                            <a href="{:U('Screen/changeStatus?method=delete&id='.$vo['id'])}" class="confirm ajax-get">删除</a>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
        //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav("{:U('Store/index')}");
    </script>
</block>
